<?php 
ob_start();
session_start();
require('fun.php');
require('lang.php');
?><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>删除推文</title>
</head>
<body>
<?php if (ADMIN_PASSWORD==='---') die('尚未设置管理员密码。请修改lang.php</body></html>'); ?>
正在准备删除一条推文，请输入密码
<form action="" method="post">
  <label>
  管理员密码
  <input name="p" type="password" id="p">
  </label>
  <input type="submit" name="Submit" value="登陆并删除">
</form><?php 
if (isset($_POST['p'])) 
$_SESSION['p'] = $_POST['p'];

if ($_SESSION['p']===ADMIN_PASSWORD) 
print(($connection->post('statuses/destroy', array('id' => $_GET['id'])))==NULL?'删除失败':'操作成功。1秒后将<a href="index.php">返回主页</a><META HTTP-EQUIV="Refresh" CONTENT="1;URL=index.php">');

?>
</body>
</html>
